import os
import logging


def walk_file(data_dir, max_depth=3, depth=0, list_num=10):
    exclude_list = ('.git', '.pyc', 'pycache', '.idea')
    if depth == 0:
        logging.info('Walk direction of {}'.format(data_dir))
        print(data_dir)

    for item in os.listdir(data_dir)[:list_num]:
        if depth == max_depth:
            break
        if not any(key for key in exclude_list if key in item):
            new_dir = data_dir + '/' + item
            if os.path.isdir(new_dir):
                print("   " * depth + "+--" + item + '/')
                walk_file(new_dir, max_depth, depth + 1)
            else:
                print("   " * depth + "|--" + item)


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    walk_file('../../', max_depth=10, list_num=100)
